package com.zx.baofu.alcohol.service.impl;

import com.zx.baofu.alcohol.mapper.PeriodsAddressMapper;
import com.zx.baofu.alcohol.model.Periods;
import com.zx.baofu.alcohol.model.PeriodsAddress;
import com.zx.baofu.alcohol.model.Result;
import com.zx.baofu.alcohol.service.PeriodsAddressService;
import com.zx.baofu.alcohol.service.PeriodsService;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class PeriodsAddressServiceImpl implements PeriodsAddressService {
    @Autowired
    PeriodsAddressMapper periodsAddressMapper;


    @Override
    public Result getByPeriodsId(Long periodsId) {
        PeriodsAddress periodsAddress=periodsAddressMapper.getByPeriodsId(periodsId);
        return new Result().success("修改成功",periodsAddress);
    }

    @Override
    public Result updatePeriodsAddress(PeriodsAddress periodsAddress) {
        System.out.println(periodsAddress.getLongitude());
        int res=periodsAddressMapper.updatePeriodsAddress(periodsAddress);
        System.out.println(res);
        if(res<=0){
            return new Result().fail("修改失败");
        }
        return new Result().success("修改成功");
    }
}
